package com.iraeta.controller.basic;

import com.iraeta.common.AuthAccess;
import com.iraeta.controller.BaseController;

import com.iraeta.service.ErpU9_Interface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController(value = "TestController")
@RequestMapping("test")
public class TestController extends BaseController {
    @Autowired
    ErpU9_Interface erpInterface;


    @RequestMapping("test1")
    @AuthAccess
    public String test1(){
        return "{ok:123}";
    }

    @RequestMapping("gettoken")
    @AuthAccess
    public String getToken(){
        String token = erpInterface.getToken("1029");
        return this.success(token);
    }

    @RequestMapping("getcunhuo")
    @AuthAccess
    public String getCunHuo(){
        String cunHuoData = erpInterface.getCunHuo("1029", "0299-00632");
        return this.success(cunHuoData);
    }
}
